user_input = input("请输入一行字符: ") # 获取用户输入
alpha_count = 0  # 初始化
space_count = 0
digit_count = 0
other_count = 0
# 遍历输入字符串中的每个字符
for str in user_input:
    if str.isalpha():
        alpha_count += 1
    elif str.isdigit():
        digit_count += 1
    elif str.isspace():
        space_count += 1
    else:
        other_count += 1
print(f"英文字母个数: {alpha_count}")
print(f"空格个数: {space_count}")
print(f"数字个数: {digit_count}")
print(f"其他字符个数: {other_count}")